package com.bw.controller;

import com.bw.po.Dept;
import com.bw.result.Result;
import com.bw.service.DeptService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author：lau
 * @Package：com.bw.controller
 * @Project：my-framework
 * @name：IndexController
 * @Date：2025/11/3 11:40
 * @Filename：IndexController
 */
@Tag(name = "部门管理")
@RestController
@RequestMapping("/depts")
public class DeptController {
    @Autowired
    private DeptService deptService;
    // 获取部门列表
    @Operation(summary = "获取所有部门列表")
    @GetMapping
    // 使用mybait-plus实现员工列表的分页
    public Result<?> list() {
        Map m = deptService.getAllDepts();
        return Result.success(m);
    }
}
